package org.poem;

import org.poem.service.AsyncTaskService;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.scheduling.annotation.EnableAsync;

/**
 * Created by poem on 2017/8/27.
 */
@EnableAsync
@SpringBootApplication
public class Main {


    public static void main(String[] args) {
        AnnotationConfigApplicationContext configApplicationContext = new AnnotationConfigApplicationContext(Main.class);
        AsyncTaskService service = configApplicationContext.getBean(AsyncTaskService.class);
        for (int i=0;i<100;i++){
            service.executorAsyncTask(i);
            service.executorAsyncTaskPlus(i);
        }
        configApplicationContext.close();
    }
}
